import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Switch } from 'ant-design-vue';
import {getLevelSelectsApi, getCategorySelectsApi} from '@/api/sys/common';

import { useMessage } from '@/hooks/web/useMessage';

type CheckedType = boolean | string | number;
export const columns: BasicColumn[] = [
  {
    title: '班级名称',
    dataIndex: 'clazzName',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
  },

];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyword',
    label: '班级名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'clazzName',
    label: '班级名称',
    required: true,
    component: 'Input',
  },
  {
    label: '职级',
    field: 'levels',
    component: 'ApiSelect',
    componentProps: {
      api: getLevelSelectsApi,
      mode:"multiple",
      resultField:"data",
      labelField: 'label',
      valueField: 'value',
    },
    required: true,
  },
];
